package org.design.hotdevelop.controller;

import jakarta.annotation.Resource;
import org.design.hotdevelop.service.OrderService;
import org.design.hotdevelop.service.SwitchService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description:
 * @author: freedom
 * @date: 2024/9/25
 **/
@RestController
@RequestMapping("/test")
public class DemoController {

    @Resource
    private OrderService orderService;

    @Resource
    private SwitchService switchService;

    @GetMapping("")
    public Map<String,String> get (String name) {
        return orderService.show(name);
    }

    @GetMapping("/switch")
    public Map<String,String> get (@RequestBody Map<String,Object> param) {
        return switchService.update(param);
    }
}
